package 补充.输入输出操作.字节流;

import java.io.FileInputStream;
import java.io.IOException;

public class 字节流操作文件读取 {

    public static void main(String[] args) {
        FileInputStream fis = null;
        try {
            fis=new FileInputStream("D:\\Learn\\javademo\\untitled\\src\\补充_偏\\输入输出操作\\read.txt");
            int n=512;
            byte[] b=new byte[n];
            while ((fis.read(b,0,n)!=-1)){
                System.out.println(new String(b));
            }
        } catch (Exception e) {
            System.out.println(e);
        }finally {
            try {
                fis.close();
            }catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
